#ifndef DEVICEMANAGER_HPP
#define DEVICEMANAGER_HPP

#include <kieper/Device.hpp>

#include <boost/cstdint.hpp>
#include <boost/function.hpp>
#include <boost/utility.hpp>
#include <boost/ptr_container/ptr_unordered_map.hpp>

namespace google {
namespace protobuf {
class Message;
}
}


namespace kieper {
class DeviceManager : private boost::noncopyable {
public:
    typedef boost::function<void (const google::protobuf::Message& response)> ResponseHandler;
    DeviceManager();
    ~DeviceManager();
    static void call(Device& device, uint32_t msgType,
      const google::protobuf::Message& request, ResponseHandler handler);
    static void call(Device& device, uint32_t msgType,
      const google::protobuf::Message& request,
      google::protobuf::Message& response);
protected:
private:
    boost::ptr_unordered_map<char*, Device> devices_;
};

}

#endif
